package com.cimr.comm.dao;


import com.cimr.comm.po.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author liqi on 2017-05-26.
 */
public interface UserDao {
    User getByUsername(@Param("username") String username);

//    Set<String> getRoles(String username);
//
//    Set<String> getPermissions(String username);

    User login(Map<String, Object> map);

    List<User> selectList(@Param("fullname") String fullname, @Param("groupIds") String[] groupIds);

    List<User> getListByUserType(@Param("userType") String userType);

    User getUserById(@Param("id") String id);

    int insertObject(@Param("id") String id,
                            @Param("username") String username,
                            @Param("pswd") String pswd,
                            @Param("status") int status,
                            @Param("fullname") String fullname,
                            @Param("phone") String phone,
                            @Param("email") String email,
                            @Param("comment") String comment,
                            @Param("orderId") Float orderId,
                            @Param("groupId") String groupId,
                            @Param("groupName") String groupName,
                            @Param("theme") String theme,
                            @Param("avatar") String avatar);

    int updateObject(@Param("id") String id,
                            @Param("username") String username,
                            @Param("pswd") String pswd,
                            @Param("status") int status,
                            @Param("fullname") String fullname,
                            @Param("phone") String phone,
                            @Param("email") String email,
                            @Param("comment") String comment,
                            @Param("orderId") Float orderId,
                            @Param("groupId") String groupId,
                            @Param("groupName") String groupName,
                            @Param("theme") String theme,
                            @Param("avatar") String avatar);

    int updateUserTheme(@Param("id") String id,
                               @Param("theme") String theme);

    int deleteObjectById(@Param("id") String id);

    User verifyUsernamePassword(@Param("username") String username, @Param("pswd") String pswd);

    int updatePassword(@Param("username") String username, @Param("pswd") String pswd);

    List<User> getUserListByGroupId(@Param("groupId") String groupId);
}
